package YAVMM::Types;
use warnings;
use strict;

# predeclare local types
use MooseX::Types
    -declare => [
	qw(
	      PositiveInt
      )];

# import builtin types
use MooseX::Types::Moose qw(Int);

# type definition
subtype PositiveInt,
    as      Int,
    where   { $_ > 0 },
    message { "Int is not larger than 0" };

# type coercion
coerce PositiveInt,
    from Int,
    via { 1 };

1;
